UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bE3oWcA9ByjAYrnHWL2lj1UWAiFFkufLjnlRRvWg+4w='
WHERE
key_id = '62e7031085be47d9cff8665ba0db0f39af9b45acdbf892fc1c8ebfd72fd0fd08'
AND (
token = 'bE3oWcA9ByjAYrnHWL2lj1UWAiFFkufLjnlRRvWg+4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)