UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZOCnDf2QkhL8Wi9X1vzJ52t2V0QYL09xJKFi9zTIJU='
WHERE
key_id = '49c29908cec40d8458c1ba0240a83566338c2b2d7f74c8fe68210ad85324aab9'
AND (
token = '8ZOCnDf2QkhL8Wi9X1vzJ52t2V0QYL09xJKFi9zTIJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)