UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vNOkswRy82M2kZZPqnrsDSF9WbJzz8BJzQZQWTb9xGA='
WHERE
key_id = 'bf3ba6ef8e7f2671be0cf0780d9ce0aa3ef0f8a8828483ecdb3d795acdc2f11c'
AND (
token = 'vNOkswRy82M2kZZPqnrsDSF9WbJzz8BJzQZQWTb9xGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)