UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '07qdq8ubq3Ykq+GScedUy76ae8M+73xedcjTAgl1aPA='
WHERE
key_id = '66220ec87fa5244d89cc43947e9c1ccca6240b67896a3ccce5fcd7bc13cd4595'
AND (
token = '07qdq8ubq3Ykq+GScedUy76ae8M+73xedcjTAgl1aPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)