UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KJjZNmoaRX/uK9LPhpW0aRU4KMB6pse2TrlxBvDkxTo='
WHERE
key_id = 'e62685d0130d5accfce4ed9a1464d76a41784db08cbc4f7d3743abfab703f21d'
AND (
token = 'KJjZNmoaRX/uK9LPhpW0aRU4KMB6pse2TrlxBvDkxTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)