UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anUCJIoktiIWbgtMH3aUeW6naBhXZwSSULUqNCJa/Zw='
WHERE
key_id = '4e6a8c2fccc4dfdf1b252e9b4ca9bbd1aa6613de2b01eee53a0aeb73029a3552'
AND (
token = 'anUCJIoktiIWbgtMH3aUeW6naBhXZwSSULUqNCJa/Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)