UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'URkaetN2WH/31sQ7hpkoN82+4NfmPB4DChJPkfK4/hE=' 
WHERE 
  key_id = '58bf9ca5b18ce8b700d3105cb3099def5c567673e15fd5845838eaca0698a8d4' 
  AND (
    token = 'URkaetN2WH/31sQ7hpkoN82+4NfmPB4DChJPkfK4/hE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107