UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwjouzsjUtKUrihdDu9ciV9DmPjWjf6nGmt/A3jX7oA='
WHERE
key_id = '7fe8c36dc6772cc488d24e17abd32d1ccd245a274fa9884f2a0255bbaf44f3ed'
AND (
token = 'uwjouzsjUtKUrihdDu9ciV9DmPjWjf6nGmt/A3jX7oA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)