UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vVs8/ZoLJHkQ9Gwgg4vEtVZ6O3x3gkuzyiSTDtiE2TU=' 
WHERE 
  key_id = '6ec96628a2f4911517e61906476f2b3cf9f0bbad1b138ce86f308bb130aa75dc' 
  AND (
    token = 'vVs8/ZoLJHkQ9Gwgg4vEtVZ6O3x3gkuzyiSTDtiE2TU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028