UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4YFqEavJWvUIxVzIxTtvYDNdKcBf5nHrKQMZhKbNVm0='
WHERE
key_id = 'fcd0fea52d0183541d85a5a8618f1e47625adf489e7b22480dd0e6ee41183e47'
AND (
token = '4YFqEavJWvUIxVzIxTtvYDNdKcBf5nHrKQMZhKbNVm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)