UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ztE4vrCoQfPUFtdUV7sWc7pc80pQ0lEOmMlKPL7X6yY='
WHERE
key_id = '841f279f376eb21df6f1ba2475f759c52fa1783237e06e312603964b0ae22149'
AND (
token = 'ztE4vrCoQfPUFtdUV7sWc7pc80pQ0lEOmMlKPL7X6yY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)