UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/phRe2VSLEiZ39mf4gPGPc7JJskQJuzzgnfBKKkM/2Y='
WHERE
key_id = 'b7ebbc8cf20367ccbf318c23930ec8dee0ac815124a68a173591e522bf9d95ca'
AND (
token = '/phRe2VSLEiZ39mf4gPGPc7JJskQJuzzgnfBKKkM/2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)