UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XzV5fpCo63V9nIqh3hqtcRJjX6NfoHC46itugjX2Nds='
WHERE
key_id = '64f07b02e73cc7a6008949e0e8f9b245f00adbc07699f505bfc5107df6223c95'
AND (
token = 'XzV5fpCo63V9nIqh3hqtcRJjX6NfoHC46itugjX2Nds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)