UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YuHIN+Ilf1DxsgAw0dEbkmWnSGbhHt+iMk52d/1/bBQ='
WHERE
key_id = '40db9cfbc80719941446278777d35b7b0af1ef7a8aac37358171689bee9ae5d0'
AND (
token = 'YuHIN+Ilf1DxsgAw0dEbkmWnSGbhHt+iMk52d/1/bBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)