UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qn6OR3QvjuMVpFT6FtFBVN6dcDeD+OzFkwTrMnMIR4E='
WHERE
key_id = 'd73e9439971ae9a10dfec02f11851328740de604359ee3d8fed0a494ac1b9d9a'
AND (
token = 'qn6OR3QvjuMVpFT6FtFBVN6dcDeD+OzFkwTrMnMIR4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)