UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm1qOtLB2/mFan6DRT9oC26KFaJTsTNLjlPPq/ww/8dA='
WHERE
key_id = 'd1519ed69c01ad746dcb85f237cfcf6d85346974b5e80939ae962e368f65bcc2'
AND (
token = 'm1qOtLB2/mFan6DRT9oC26KFaJTsTNLjlPPq/ww/8dA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)