UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zY8Fi3tOb+2Hqc7Uykzr8G1SdR6KoZLTeBlPeDrdQVc='
WHERE
key_id = '6ebab3e2a8a28c1b6ec8cc62692514b7d69e38998f023a20d57bc4e8d1c53f0e'
AND (
token = 'zY8Fi3tOb+2Hqc7Uykzr8G1SdR6KoZLTeBlPeDrdQVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)