UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7pzxj3imJLJrNy1g1KDhlCYwS25xikjtBDfNqWTXZVE='
WHERE
key_id = 'b3bce0accd413e98bdcd8cf257a94dacc9460cf0607b078cadb87d1c68b9ef4d'
AND (
token = '7pzxj3imJLJrNy1g1KDhlCYwS25xikjtBDfNqWTXZVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)