UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cztRoreysySHucBgTWFrjSMKZrJ6gpFQSrm3Vh6b/v4='
WHERE
key_id = '8e44161dff2f7f6d7df61fd2ce13ed0449765a083de194cf250fcb45348f4324'
AND (
token = 'cztRoreysySHucBgTWFrjSMKZrJ6gpFQSrm3Vh6b/v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)