UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41RSY5dJ3gyR6/mOuJ3vY0VBJdvu395GRyZFu9lv6qI='
WHERE
key_id = 'c50c4fee4fdd96e5d547ead8b419278453e6b65e87acfae71130fb86fcbbc1e4'
AND (
token = '41RSY5dJ3gyR6/mOuJ3vY0VBJdvu395GRyZFu9lv6qI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)