UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TSiUSI7MIv8PCwPOUWw+1iEaIJn/lzC92Zd2hIwXAQM='
WHERE
key_id = '8bec18b25c8e4cb2e77bdf2eac572f29cb33e5045b212f750bb1c5248b4aefb6'
AND (
token = 'TSiUSI7MIv8PCwPOUWw+1iEaIJn/lzC92Zd2hIwXAQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)