UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vpplV9B/6VTHEZczPZSkxM0pmCBCaYZ8d/RZ9Q5S0oY=' 
WHERE 
  key_id = '53f2f2e601f9aa8aa3baf394788b4d59688730c6897116795cd50aff94751089' 
  AND (
    token = 'vpplV9B/6VTHEZczPZSkxM0pmCBCaYZ8d/RZ9Q5S0oY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031