UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WahOvUEuQ16WKgpSROLOtwdsUbBmDWcGhh6ldvmukVI=' 
WHERE 
  key_id = 'baaa361011d1385373e3c561667e773f5b049106599b23bfa5b3311a609d859b' 
  AND (
    token = 'WahOvUEuQ16WKgpSROLOtwdsUbBmDWcGhh6ldvmukVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030