UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmxf+ZsFlZT8aPCqYHsMqE6/t8y3fC6e5zLpvNx/ZtI='
WHERE
key_id = '399edab0f29565ae9224aa7068121ef64cbeae7e0ba68f7b5657fcee97a61d8b'
AND (
token = 'mmxf+ZsFlZT8aPCqYHsMqE6/t8y3fC6e5zLpvNx/ZtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)