UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YihHdgGzEwYC0FHCYA+ouBwFC+S2/nTBWf9azXMSU54='
WHERE
key_id = 'b7709bf28000c44d416179a7cd31d8be1e1fb533f6f25fe22d2fe435b4817d21'
AND (
token = 'YihHdgGzEwYC0FHCYA+ouBwFC+S2/nTBWf9azXMSU54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)