UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v7iNtDggahqhv7mYxuiF/Nr9ltsa+VVlQ3QZ+XiuzeE=' 
WHERE 
  key_id = '033ebbd29b980e66be305cabefdf66c0f5f30ad4b1523d897b5b3888c57dff1e' 
  AND (
    token = 'v7iNtDggahqhv7mYxuiF/Nr9ltsa+VVlQ3QZ+XiuzeE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033