UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ewizK+Ip4tEizBCe+pWVDtnPT1ShPNV69f44PbHveLE=' 
WHERE 
  key_id = '7c59eb63d00be9c6743e48f8cece7957d31cd6cfb1c0a8871f66acdac52f7cbe' 
  AND (
    token = 'ewizK+Ip4tEizBCe+pWVDtnPT1ShPNV69f44PbHveLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037