UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2bDHqEIJBTlnCzxIkXQy4fcdtCXgUWjxQ0gQDbVLOxQ='
WHERE
key_id = '1a26b6efca68d20f76004b1d7536b9b1c9d1eb82544006f0329a7f2203c8e78f'
AND (
token = '2bDHqEIJBTlnCzxIkXQy4fcdtCXgUWjxQ0gQDbVLOxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)