UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RsSM3+ZltAXaiEJpuqTQnB3pHognAlsf4dMyEXO4IEE=' 
WHERE 
  key_id = '81d7cb1fc4869bc2ef54d2029319f6df0385c391efb7ae93b750de17f9937ed2' 
  AND (
    token = 'RsSM3+ZltAXaiEJpuqTQnB3pHognAlsf4dMyEXO4IEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037