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