UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MyQ733/MWGyHDnPzAiJ7RYmHZleeQHNcBSxSbG9zEe4=' 
WHERE 
  key_id = '66f300a7008bf386ecfc2199c05b8b3c52166b2f930e396ace2b8b1c3aaf8607' 
  AND (
    token = 'MyQ733/MWGyHDnPzAiJ7RYmHZleeQHNcBSxSbG9zEe4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027