UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '23q2jZpzMtAkcmHwMerXpXVG7HUNXPWyWEZjNJq28Dw='
WHERE
key_id = 'd724152722ee53ca18f80f5821c88cd624bec4e2d2357ce5a3a0882f8f8b8a69'
AND (
token = '23q2jZpzMtAkcmHwMerXpXVG7HUNXPWyWEZjNJq28Dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)