UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7EF11QsLoD2FcoAQiP6jITTp6wgMxATFwdm3JVfAA2M=' 
WHERE 
  key_id = '0a2db661fb2d64130ee5b70d96264f45eade7d01c5b1550770ae2c99629491c2' 
  AND (
    token = '7EF11QsLoD2FcoAQiP6jITTp6wgMxATFwdm3JVfAA2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050