UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tNV2zgJtpITY906f7CpkWA64pNrQF+7dCPWJIztWURk=' 
WHERE 
  key_id = 'f5761344b8c56733c28b83d7269392d238eb3ba546617afc6616128667944beb' 
  AND (
    token = 'tNV2zgJtpITY906f7CpkWA64pNrQF+7dCPWJIztWURk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015