UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AdfC+BFoXRdi6IAvvpOE0ClOG6zlP+EZ/SY11ptII34='
WHERE
key_id = 'e41738cd9e8016fa1ed239d61fe955a074cfaf055d4a5e1cd39a90f69e5bc621'
AND (
token = 'AdfC+BFoXRdi6IAvvpOE0ClOG6zlP+EZ/SY11ptII34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)