UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vcKA4t3ZeWdRcNf/vT8bKBF4nglXQcBAlMFRYc6kxwE='
WHERE
key_id = '9e2107fda412d00dbd53075869013da8d5037e4b9686d03347675433844d282b'
AND (
token = 'vcKA4t3ZeWdRcNf/vT8bKBF4nglXQcBAlMFRYc6kxwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)