UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OxJGuwz2SVb7kz5X9iQKFZTLCfZCaqiu8pE2q8xq5Ug=' 
WHERE 
  key_id = '14dbcb86103386ab2b16f810e344be75797759fdbe25ae42dee7f58e8ba65666' 
  AND (
    token = 'OxJGuwz2SVb7kz5X9iQKFZTLCfZCaqiu8pE2q8xq5Ug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052