UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TlpHWa86XTnbLVX4vVNaujCJX/TQ10EmVTLQsAMJfxY='
WHERE
key_id = '43e79dc4944b0b61310a1387ce650fdea8c62ac9682c5e36a5f579deb8b0f017'
AND (
token = 'TlpHWa86XTnbLVX4vVNaujCJX/TQ10EmVTLQsAMJfxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)