UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NdcXsVacwJ48lW1oGq3qCzJNGL2Kso/UNkCf16mJCHU='
WHERE
key_id = 'ae3e9d9e4c5ee457bd0c05e26ac09bd2b2954ed3a8f8fbb5026e415c128d3c61'
AND (
token = 'NdcXsVacwJ48lW1oGq3qCzJNGL2Kso/UNkCf16mJCHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)