UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sRuZhl6sJltwB5CRrzbeVYy5vtc0Lu11YwzE74Z1YqU='
WHERE
key_id = '658463a5ddd6d1ee5f4d338e362ea289bf0dfcd1144b09766b97d3f7d93b9fd0'
AND (
token = 'sRuZhl6sJltwB5CRrzbeVYy5vtc0Lu11YwzE74Z1YqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)