UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1s8/u+XUfXZIIE3cE2eVFP4P/ulgajbpAbxmxpCeVb8=' 
WHERE 
  key_id = '9fdf388f0b0137f80b3202c838071c842e3609bc8d5fe07c9757dd50092e5a07' 
  AND (
    token = '1s8/u+XUfXZIIE3cE2eVFP4P/ulgajbpAbxmxpCeVb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036