UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nVIwav5B8NZCzt7PzQP4sm/4/hY2BdUaDhPF+4G+Rng='
WHERE
key_id = 'af7d4130d1cc9a12fb32fc3c377433c7562f96c4ef5cf6d05e1856728b1e1e5e'
AND (
token = 'nVIwav5B8NZCzt7PzQP4sm/4/hY2BdUaDhPF+4G+Rng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)