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

Query time 0.00022