UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IK1yxTy2MzIoxnVd6HKhVs17czkNySQ9aeWtELi5PKo='
WHERE
key_id = '6fd896060db1640f697b9040721e69716b7400546989177cfc9286fe95fea31d'
AND (
token = 'IK1yxTy2MzIoxnVd6HKhVs17czkNySQ9aeWtELi5PKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)