UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wi5dGH3X2tSDUa8D1ZpbUIBz9A4dBDDz5ASO9H4JCrE='
WHERE
key_id = '83d7c9317c74b49396c1e435587252ce25cdf3a3b6e8de7766d73c6544bf5fc3'
AND (
token = 'Wi5dGH3X2tSDUa8D1ZpbUIBz9A4dBDDz5ASO9H4JCrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)